package org.naigu.peach.web.action;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import guda.grape.mvc.uribox.URIBox;
import guda.grape.util.RequestUtil;
import org.naigu.peach.biz.UserBiz;
import org.naigu.peach.biz.form.RegForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by well on 15/10/17.
 */
@Api(value="", description="Operations on Businesses", position = 2)
@Controller
public class RegAction {

    @Autowired
    private UserBiz userBiz;
    @Autowired
    private URIBox homeServer;

    @ApiOperation(value = "注册", httpMethod = "POST", response = String.class, notes = "注册地")
    @RequestMapping(value = "reg.htm", method = RequestMethod.GET)
    public String create(HttpServletRequest request, ModelMap modelMap, RegForm regForm,
                         BindingResult result) {
        modelMap.put("homeServer",homeServer);
        modelMap.put("ttt",request.getSession().getAttribute("abc"));
        return RequestUtil.resolveVM(request);
    }
}
